import request from '/@/utils/request';
/**
 * @method goodsList 商品列表
 * @method goodsAdd 添加商品
 * @method goodsEdit 编辑商品
 * @method goodsEditSku 编辑商品sku
 * @method goodsEditStock 加或减库存
 * @method goodsEditVirtualSales 加或减销量
 * @method goodsEditStatus 商品上下架
 * @method goodsSelect 查询商品详情
 * @method goodsSelectSku 查询商品详情  sku
 * @method goodsSelectClass 选择商品分类
 * @method goodsSelectSupplier 选择供应商
 * @method goodsSelectGoodsBrand 选择商品品牌
 * @method goodsSelectFreightTemplate 选择运费模板
 * @method goodsSelectSupplierAddress 选择供应商退换货地址
 */
export const goodsApi = () => {
	return {
		goodsList: (params?: object) => {
			return request({
				url: '/supplier/goods_list',
				method: 'get',
				params: params,
			});
		},
		goodsAdd: (params?: object) => {
			return request({
				url: '/supplier/goods_add',
				method: 'post',
				data: params,
			});
		},
		goodsEdit: (params?: object) => {
			return request({
				url: '/supplier/goods_edit',
				method: 'post',
				data: params,
			});
		},
		goodsEditSku: (params?: object) => {
			return request({
				url: '/supplier/goods_edit_sku',
				method: 'post',
				data: params,
			});
		},
		goodsEditStock: (params?: object) => {
			return request({
				url: '/supplier/goods_edit_stock',
				method: 'post',
				data: params,
			});
		},
		goodsEditVirtualSales: (params?: object) => {
			return request({
				url: '/supplier/goods_edit_virtual_sales',
				method: 'post',
				data: params,
			});
		},
		goodsEditStatus: (params?: object) => {
			return request({
				url: '/supplier/goods_edit_status',
				method: 'post',
				data: params,
			});
		},
		goodsSelect: (params?: object) => {
			return request({
				url: '/supplier/goods_select',
				method: 'get',
				params: params,
			});
		},
		goodsSelectSku: (params?: object) => {
			return request({
				url: '/supplier/goods_select_sku',
				method: 'get',
				params: params,
			});
		},
		goodsSelectClass: (params?: object) => {
			return request({
				url: '/supplier/goods_select_class',
				method: 'get',
				params: params,
			});
		},
		goodsSelectSupplier: (params?: object) => {
			return request({
				url: '/supplier/goods_select_supplier',
				method: 'get',
				params: params,
			});
		},
		goodsSelectGoodsBrand: (params?: object) => {
			return request({
				url: '/supplier/goods_select_goods_brand',
				method: 'get',
				params: params,
			});
		},
		goodsSelectFreightTemplate: (params?: object) => {
			return request({
				url: '/supplier/goods_select_freight_template',
				method: 'get',
				params: params,
			});
		},
		goodsSelectSupplierAddress: (params?: object) => {
			return request({
				url: '/supplier/goods_select_supplier_address',
				method: 'get',
				params: params,
			});
		},
	};
};
/**
 * @method supplierAddressList 供应商退货地址列表
 * @method supplierAddressAdd 添加供应商退货地址
 * @method supplierAddressEdit 编辑供应商退货地址
 * @method supplierAddressDelete 删除供应商退货地址
 * @method supplierAddressInfo 获取供应商退货地址信息
 */
export const supplierApi = () => {
	return {
		supplierAddressList: (params?: object) => {
			return request({
				url: '/supplier/supplier_address_list',
				method: 'get',
				params: params,
			});
		},
		supplierAddressAdd: (params?: object) => {
			return request({
				url: '/supplier/supplier_address_add',
				method: 'post',
				data: params,
			});
		},
		supplierAddressEdit: (params?: object) => {
			return request({
				url: '/supplier/supplier_address_edit',
				method: 'post',
				data: params,
			});
		},
		supplierAddressDelete: (params?: object) => {
			return request({
				url: '/supplier/supplier_address_delete',
				method: 'post',
				data: params,
			});
		},
		supplierAddressInfo: (params?: object) => {
			return request({
				url: '/supplier/supplier_address_info',
				method: 'get',
				params: params,
			});
		},
	};
};
/**
 * @method orderList 订单列表
 * @method orderDeliverNew 单个发货
 */
export const orderApi = () => {
	return {
		orderList: (params?: object) => {
			return request({
				url: '/supplier/order_list',
				method: 'get',
				params: params,
			});
		},
		orderDeliverNew: (params?: object) => {
			return request({
				url: '/supplier/order_deliver_new',
				method: 'post',
				data: params,
			});
		},
	};
};
/**
 * @method logisticsList 物流公司列表
 */
export const logisticsApi = () => {
	return {
		logisticsList: (params?: object) => {
			return request({
				url: '/supplier/logistics_list',
				method: 'get',
				params: params,
			});
		},
	}
}
/**
 * @method langGoodsEdit 商品相关单个翻译保存
 */
export const langApi = () => {
	return {
		langGoodsEdit: (params?: object) => {
			return request({
				url: '/supplier/lang_goods_edit',
				method: 'post',
				data: params,
			});
		},
	};
};
/**
 * @method orderSettleSupplier 订单列表
 * @method orderSettleSupplierNum 查询订单列表数量
 * @method selectOrderMoneyInformation 选中订单金额信息
 * @method applyOrder 申请提现
 * @method supplierWithdrawalList 提现记录
 * @method supplierBillDetails 账单详情（待审核/待打款/已打款）
 * @method supplierBillDetailsRefuse 账单详情（已拒绝）
 * @method orderAfterInfo 售后详情信息
 * @method withdrawalOrderAfterLog 售后记录
 */
export const supplierWithdrawalApi = () => {
	return {
		orderSettleSupplier: (params?: object) => {
			return request({
				url: '/supplier/order_settle_supplier',
				method: 'get',
				params: params,
			});
		},
		orderSettleSupplierNum: (params?: object) => {
			return request({
				url: '/supplier/order_settle_supplier_num',
				method: 'get',
				params: params,
			});
		},
		selectOrderMoneyInformation: (params?: object) => {
			return request({
				url: '/supplier/select_order_money_information',
				method: 'get',
				params: params,
			});
		},
		applyOrder: (params?: object) => {
			return request({
				url: '/supplier/apply_order',
				method: 'post',
				data: params,
			});
		},
		supplierWithdrawalList: (params?: object) => {
			return request({
				url: '/supplier/supplier_withdrawal_list',
				method: 'get',
				params: params,
			});
		},
		supplierBillDetails: (params?: object) => {
			return request({
				url: '/supplier/supplier_bill_details',
				method: 'get',
				params: params,
			});
		},
		supplierBillDetailsRefuse: (params?: object) => {
			return request({
				url: '/supplier/supplier_bill_details_refuse',
				method: 'get',
				params: params,
			});
		},
		orderAfterInfo: (params?: object) => {
			return request({
				url: '/supplier/order_after_info',
				method: 'get',
				params: params,
			});
		},
		withdrawalOrderAfterLog: (params?: object) => {
			return request({
				url: '/supplier/Withdrawal_order_after_log',
				method: 'get',
				params: params,
			});
		},
	}
}